package com.google.code.coma.space;

import org.mozartspaces.capi3.Selector;

/**
 * A SpaceSelector has to be used to access the entries in the space. Similar to popular database libraries or OR mapper
 * implementations this class provides a callback which allows the superior application to deal with the entries directly.
 * <p/>
 * The advantage of this solution is, that the application has complete control of the whole transaction and the framework
 * itself only has to provide the infrastructure code. This allows us to write powerful applications with a minimum of
 * lines of code in the application.
 *
 * @author Dominik Strasser, dominikstr@gmail.com
 */
public class SpaceSelector implements Selector {
	private SelectorCallback callback;

	public SpaceSelector(SelectorCallback callback) {
		this.callback = callback;
	}

	@Override
	public String getName() {
		return ComaFIFOCoordinator.name;
	}

	public SelectorCallback getCallback() {
		return callback;
	}

	@Override
	public int getCount() {
		return 0;
	}

	public static String SELECTOR_NAME = ComaFIFOCoordinator.name;
}
